package com.tianlang.jfinal.base;

import com.jfinal.plugin.activerecord.Record;

/**
 * 返回结果json
 * 
 * @author mcp
 *
 * @param <M>
 */
public class BaseRest {
	/**处理结果**/
	private boolean success = true;
	private String msg = "";
	private Record data = new Record();

	/**
	 * 默认操作成功
	 */
	public BaseRest() {
	}

	/**
	 * 成功且返回数据
	 * @param data
	 */
	public BaseRest(Record data) {
		this.data = data;
	}

	/**
	 * 操作失败构造
	 * @param msg
	 */
	public BaseRest(String msg) {
		this.msg = msg;
		this.success = false;
	}

	public boolean getSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Record getData() {
		return data;
	}

	public void setData(Record data) {
		this.data = data;
	}

}
